#pragma once

#include <string>
#include "../Tinyxml2/tinyxml2.h"

class Field
{
public:
	Field();
	Field(const std::string &name);
	Field(const std::string &name, const std::string &type, int length, bool notNull, const std::string &defaultValue, const std::string &key, const std::string &extra);
	Field(const Field &from);
	~Field();

	Field& operator=(const Field& from);

	bool operator==(const Field& field)
	{
		return name_ == field.name_;
	}

	void load(tinyxml2::XMLElement *element);

public:
	std::string name_;
	std::string type_;
	int length_;
	bool notNull_;
	std::string defaultValue_;
	std::string key_;
	std::string extra_;
};

